package cn.antho.superhelp.domain;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author director
 * @since 2022-12-12
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("t_reservation")
public class Reservation extends Model<Reservation> {

    private static final long serialVersionUID = 1L;

    public static final Integer UNASSIGNED_TO_BE_SURVEYED = 0;
    public static final Integer ASSIGNED_TO_BE_SURVEYED = 1;
    public static final Integer RESERVED_TO_BE_SURVEYED = 2;
    public static final Integer SURVEYED_AND_COMMUNICATED = 3;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 预约单id
     */
    @TableField("reservation_no")
    private String reservationNo;
    /**
     * 下预约单时间
     */
    @TableField("create_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 勘测师id
     */
    private Long surveyor;
    /**
     * 预约勘测时间
     */
    @TableField("appointment_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date appointmentTime;
    /**
     * 实际上门时间
     */
    @TableField("real_appointment_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date realAppointmentTime;
    /**
     * 需求备注
     */
    private String demand;
    /**
     * 图片
     */
    private String pics;
    /**
     * 预约单状态
     * 0、未分配待勘测
     * 1、已分配待勘测
     * 2、已预约待勘测
     * 3、已勘测已沟通
     */
    @TableField("status_reservation")
    private Integer statusReservation;
    /**
     * 用户
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 地址
     */
    private String address;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Reservation{" +
        ", id=" + id +
        ", reservationNo=" + reservationNo +
        ", createTime=" + createTime +
        ", surveyor=" + surveyor +
        ", appointmentTime=" + appointmentTime +
        ", realAppointmentTime=" + realAppointmentTime +
        ", demand=" + demand +
        ", pics=" + pics +
        ", statusReservation=" + statusReservation +
        ", userId=" + userId +
        "}";
    }
}
